#!/bin/bash

# Test join to the clean cluster

. ./common

for i in 0 1 2; do
    _start_sheep $i
done

_wait_for_sheep 3

# start Sheepdog with 3 nodes
_cluster_format

$DOG cluster shutdown -p 7000
_wait_for_sheep_stop

for i in 3 4 5; do
    _start_sheep $i
done

_wait_for_sheep 3 3

for i in 0 1 2; do
    _start_sheep $i
done

_wait_for_sheep 6

for i in `seq 0 5`; do
    $DOG cluster info -p 700$i | _filter_cluster_info
done
